<style>
</style>
<form>
<div><input type="checkbox"></div>
<div><input type="text" size="30" value="placeholder"></div>
<div><input type="text" size="10" value="whefghijklmnopqrstuvwxyzabcdefg"></div>
<div><input id=bar1 type="text" value=""></div>
<div><button id=setdefaultvalue type=button>setDefaultValue</button>
    <button id=setvalue type=button>setValue</button></div>
<div><input id=foo1 type="checkbox"></div>
<div><input id=foo2 type="checkbox"></div>
<div><input id=foo3 type="checkbox"></div>
<div><button id=setdefault type=button>setDefaultChecked</button></div>
<div><input type="submit"><input type="reset"><div>
<div><input id=ch type="checkbox" checked></div>
<div><input id=unch type="checkbox"></div>
<div><input type="text" size="30" placeholder="this is a placeholder"></div>
<div><input type="password" size="30" placeholder="this is a password placeholder"></div>
<script>
document.getElementById("ch").indeterminate = true;
document.getElementById("unch").indeterminate = true;
var checkboxes = [document.getElementById("foo1"),
                  document.getElementById("foo2"),
                  document.getElementById("foo3")];
var textinput = document.getElementById("bar1");
var set_default_checked = document.getElementById("setdefault");
var set_default_value = document.getElementById("setdefaultvalue");
var set_value = document.getElementById("setvalue");
var x = 0;

set_default_checked.addEventListener("click", function () {
    for (var i = 0; i < 3; i++) {
        checkboxes[i].defaultChecked = (i == x);
    }
    x = (x + 1) % 3;
});

set_default_value.addEventListener("click", function () {
    textinput.defaultValue = x;
    x = (x + 1) % 3;
});

set_value.addEventListener("click", function () {
    textinput.value = "new value!";
});
</script>
<div>group 1
  <div><input type="radio"></div>
  <div><input type="radio" checked></div>
</div>
<div>group 2
  <div><input type="radio" name="a" checked></div>
  <div><input type="radio" name="a"></div>
</div>
</form>
